arsd.ttf

TrueType Font rendering. Meant to be used with arsd.simpledisplay, but it doesn't actually require that. Port of stb_truetype plus D wrappers for convenience.

Members

Aliases

stbtt_int16
alias stbtt_int16 = short
Undocumented in source.
stbtt_int32
alias stbtt_int32 = int
Undocumented in source.
stbtt_int8
alias stbtt_int8 = byte
Undocumented in source.
stbtt_uint16
alias stbtt_uint16 = ushort
Undocumented in source.
stbtt_uint32
alias stbtt_uint32 = uint
Undocumented in source.
stbtt_uint8
alias stbtt_uint8 = ubyte
Undocumented in source.
stbtt_vertex_type
alias stbtt_vertex_type = short
Undocumented in source.

Classes

OpenGlLimitedFont
class OpenGlLimitedFont(OpenGlFontGLVersion ver = OpenGlFontGLVersion.old)

Note that the constructor calls OpenGL functions and thus this must be called AFTER the context creation, e.g. on simpledisplay's window first visible delegate.

OpenGlLimitedFontBase
class OpenGlLimitedFontBase()
Undocumented in source.

Enums

OpenGlFontGLVersion
enum OpenGlFontGLVersion

Version of OpenGL you want it to use. Currently only two options.

STBTT_MACSTYLE_DONTCARE
anonymousenum STBTT_MACSTYLE_DONTCARE

///////////////////////////////////////////////////////////////////////////

STBTT_MAC_EID_ROMAN
anonymousenum STBTT_MAC_EID_ROMAN
Undocumented in source.
STBTT_MAC_LANG_ENGLISH
anonymousenum STBTT_MAC_LANG_ENGLISH
Undocumented in source.
STBTT_MS_EID_SYMBOL
anonymousenum STBTT_MS_EID_SYMBOL
Undocumented in source.
STBTT_MS_LANG_ENGLISH
anonymousenum STBTT_MS_LANG_ENGLISH
Undocumented in source.
STBTT_PLATFORM_ID_UNICODE
anonymousenum STBTT_PLATFORM_ID_UNICODE
Undocumented in source.
STBTT_UNICODE_EID_UNICODE_1_0
anonymousenum STBTT_UNICODE_EID_UNICODE_1_0
Undocumented in source.
STBTT_vmove
anonymousenum STBTT_vmove

///////////////////////////////////////////////////////////////////////////

Functions

STBTT_acos
T STBTT_acos(T x)
Undocumented in source. Be warned that the author may not have intended to support it.
STBTT_cos
T STBTT_cos(T x)
Undocumented in source. Be warned that the author may not have intended to support it.
STBTT_fabs
T STBTT_fabs(T x)
Undocumented in source. Be warned that the author may not have intended to support it.
STBTT_fmod
T STBTT_fmod(T x, T y)
Undocumented in source. Be warned that the author may not have intended to support it.
STBTT_free
void STBTT_free(void* ptr, const(void)* uptr)
Undocumented in source. Be warned that the author may not have intended to support it.
STBTT_iceil
int STBTT_iceil(T x)
Undocumented in source. Be warned that the author may not have intended to support it.
STBTT_ifloor
int STBTT_ifloor(T x)
Undocumented in source. Be warned that the author may not have intended to support it.
STBTT_malloc
void* STBTT_malloc(uint size, const(void)* uptr)
Undocumented in source. Be warned that the author may not have intended to support it.
STBTT_memcpy
void STBTT_memcpy(void* d, const(void)* s, uint count)
Undocumented in source. Be warned that the author may not have intended to support it.
STBTT_memset
void STBTT_memset(void* d, uint v, uint count)
Undocumented in source. Be warned that the author may not have intended to support it.
STBTT_pow
T STBTT_pow(T x, T y)
Undocumented in source. Be warned that the author may not have intended to support it.
STBTT_sqrt
T STBTT_sqrt(T x)
Undocumented in source. Be warned that the author may not have intended to support it.
STBTT_strlen
uint STBTT_strlen(const(void)* p)
Undocumented in source. Be warned that the author may not have intended to support it.
stbtt_BakeFontBitmap
int stbtt_BakeFontBitmap(const(ubyte)* data, int offset, float pixel_height, ubyte* pixels, int pw, int ph, int first_char, int num_chars, stbtt_bakedchar* chardata, int* ascent, int* descent, int* line_gap)
Undocumented in source. Be warned that the author may not have intended to support it.
stbtt_CompareUTF8toUTF16_bigendian
int stbtt_CompareUTF8toUTF16_bigendian(const(char)* s1, int len1, const(char)* s2, int len2)
Undocumented in source. Be warned that the author may not have intended to support it.
stbtt_FindGlyphIndex
int stbtt_FindGlyphIndex(const(stbtt_fontinfo)* info, int unicode_codepoint)
Undocumented in source. Be warned that the author may not have intended to support it.
stbtt_FindMatchingFont
int stbtt_FindMatchingFont(const(ubyte)* fontdata, const(char)* name, int flags)
Undocumented in source. Be warned that the author may not have intended to support it.
stbtt_FreeBitmap
void stbtt_FreeBitmap(ubyte* bitmap, void* userdata)
Undocumented in source. Be warned that the author may not have intended to support it.
stbtt_FreeSDF
void stbtt_FreeSDF(ubyte* bitmap, void* userdata)
Undocumented in source. Be warned that the author may not have intended to support it.
stbtt_FreeShape
void stbtt_FreeShape(const(stbtt_fontinfo)* info, stbtt_vertex* v)
Undocumented in source. Be warned that the author may not have intended to support it.
stbtt_GetBakedQuad
void stbtt_GetBakedQuad(const(stbtt_bakedchar)* chardata, int pw, int ph, int char_index, float* xpos, float* ypos, stbtt_aligned_quad* q, int opengl_fillrule)
Undocumented in source. Be warned that the author may not have intended to support it.
stbtt_GetCodepointBitmap
ubyte* stbtt_GetCodepointBitmap(stbtt_fontinfo* info, float scale_x, float scale_y, int codepoint, int* width, int* height, int* xoff, int* yoff)
Undocumented in source. Be warned that the author may not have intended to support it.
stbtt_GetCodepointBitmapBox
void stbtt_GetCodepointBitmapBox(stbtt_fontinfo* font, int codepoint, float scale_x, float scale_y, int* ix0, int* iy0, int* ix1, int* iy1)
Undocumented in source. Be warned that the author may not have intended to support it.
stbtt_GetCodepointBitmapBoxSubpixel
void stbtt_GetCodepointBitmapBoxSubpixel(stbtt_fontinfo* font, int codepoint, float scale_x, float scale_y, float shift_x, float shift_y, int* ix0, int* iy0, int* ix1, int* iy1)
Undocumented in source. Be warned that the author may not have intended to support it.
stbtt_GetCodepointBitmapSubpixel
ubyte* stbtt_GetCodepointBitmapSubpixel(stbtt_fontinfo* info, float scale_x, float scale_y, float shift_x, float shift_y, int codepoint, int* width, int* height, int* xoff, int* yoff)
Undocumented in source. Be warned that the author may not have intended to support it.
stbtt_GetCodepointBox
int stbtt_GetCodepointBox(stbtt_fontinfo* info, int codepoint, int* x0, int* y0, int* x1, int* y1)
Undocumented in source. Be warned that the author may not have intended to support it.
stbtt_GetCodepointHMetrics
void stbtt_GetCodepointHMetrics(const(stbtt_fontinfo)* info, int codepoint, int* advanceWidth, int* leftSideBearing)
Undocumented in source. Be warned that the author may not have intended to support it.
stbtt_GetCodepointKernAdvance
int stbtt_GetCodepointKernAdvance(stbtt_fontinfo* info, int ch1, int ch2)
Undocumented in source. Be warned that the author may not have intended to support it.
stbtt_GetCodepointSDF
ubyte* stbtt_GetCodepointSDF(stbtt_fontinfo* info, float scale, int codepoint, int padding, ubyte onedge_value, float pixel_dist_scale, int* width, int* height, int* xoff, int* yoff)
Undocumented in source. Be warned that the author may not have intended to support it.
stbtt_GetCodepointShape
int stbtt_GetCodepointShape(stbtt_fontinfo* info, int unicode_codepoint, stbtt_vertex** vertices)
Undocumented in source. Be warned that the author may not have intended to support it.
stbtt_GetFontBoundingBox
void stbtt_GetFontBoundingBox(const(stbtt_fontinfo)* info, int* x0, int* y0, int* x1, int* y1)
Undocumented in source. Be warned that the author may not have intended to support it.
stbtt_GetFontNameString
const(char)* stbtt_GetFontNameString(stbtt_fontinfo* font, int* length, int platformID, int encodingID, int languageID, int nameID)
Undocumented in source. Be warned that the author may not have intended to support it.
stbtt_GetFontOffsetForIndex
int stbtt_GetFontOffsetForIndex(const(ubyte)* data, int index)
Undocumented in source. Be warned that the author may not have intended to support it.
stbtt_GetFontVMetrics
void stbtt_GetFontVMetrics(const(stbtt_fontinfo)* info, int* ascent, int* descent, int* lineGap)
Undocumented in source. Be warned that the author may not have intended to support it.
stbtt_GetFontVMetricsOS2
int stbtt_GetFontVMetricsOS2(stbtt_fontinfo* info, int* typoAscent, int* typoDescent, int* typoLineGap)
Undocumented in source. Be warned that the author may not have intended to support it.
stbtt_GetFontXHeight
int stbtt_GetFontXHeight(stbtt_fontinfo* info, int* xHeight)
Undocumented in source. Be warned that the author may not have intended to support it.
stbtt_GetGlyphBitmap
ubyte* stbtt_GetGlyphBitmap(stbtt_fontinfo* info, float scale_x, float scale_y, int glyph, int* width, int* height, int* xoff, int* yoff)
Undocumented in source. Be warned that the author may not have intended to support it.
stbtt_GetGlyphBitmapBox
void stbtt_GetGlyphBitmapBox(stbtt_fontinfo* font, int glyph, float scale_x, float scale_y, int* ix0, int* iy0, int* ix1, int* iy1)
Undocumented in source. Be warned that the author may not have intended to support it.
stbtt_GetGlyphBitmapBoxSubpixel
void stbtt_GetGlyphBitmapBoxSubpixel(stbtt_fontinfo* font, int glyph, float scale_x, float scale_y, float shift_x, float shift_y, int* ix0, int* iy0, int* ix1, int* iy1)

///////////////////////////////////////////////////////////////////////////

stbtt_GetGlyphBitmapSubpixel
ubyte* stbtt_GetGlyphBitmapSubpixel(stbtt_fontinfo* info, float scale_x, float scale_y, float shift_x, float shift_y, int glyph, int* width, int* height, int* xoff, int* yoff)
Undocumented in source. Be warned that the author may not have intended to support it.
stbtt_GetGlyphBox
int stbtt_GetGlyphBox(stbtt_fontinfo* info, int glyph_index, int* x0, int* y0, int* x1, int* y1)
Undocumented in source. Be warned that the author may not have intended to support it.
stbtt_GetGlyphHMetrics
void stbtt_GetGlyphHMetrics(const(stbtt_fontinfo)* info, int glyph_index, int* advanceWidth, int* leftSideBearing)
Undocumented in source. Be warned that the author may not have intended to support it.
stbtt_GetGlyphKernAdvance
int stbtt_GetGlyphKernAdvance(stbtt_fontinfo* info, int g1, int g2)
Undocumented in source. Be warned that the author may not have intended to support it.
stbtt_GetGlyphSDF
ubyte* stbtt_GetGlyphSDF(stbtt_fontinfo* info, float scale, int glyph, int padding, ubyte onedge_value, float pixel_dist_scale, int* width, int* height, int* xoff, int* yoff)
Undocumented in source. Be warned that the author may not have intended to support it.
stbtt_GetGlyphShape
int stbtt_GetGlyphShape(stbtt_fontinfo* info, int glyph_index, stbtt_vertex** pvertices)
Undocumented in source. Be warned that the author may not have intended to support it.
stbtt_GetNumberOfFonts
int stbtt_GetNumberOfFonts(const(ubyte)* data)
Undocumented in source. Be warned that the author may not have intended to support it.
stbtt_GetPackedQuad
void stbtt_GetPackedQuad(const(stbtt_packedchar)* chardata, int pw, int ph, int char_index, float* xpos, float* ypos, stbtt_aligned_quad* q, int align_to_integer)
Undocumented in source. Be warned that the author may not have intended to support it.
stbtt_InitFont
int stbtt_InitFont(stbtt_fontinfo* info, const(ubyte)* data, int offset)
Undocumented in source. Be warned that the author may not have intended to support it.
stbtt_IsGlyphEmpty
int stbtt_IsGlyphEmpty(stbtt_fontinfo* info, int glyph_index)
Undocumented in source. Be warned that the author may not have intended to support it.
stbtt_MakeCodepointBitmap
void stbtt_MakeCodepointBitmap(stbtt_fontinfo* info, ubyte* output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, int codepoint)
Undocumented in source. Be warned that the author may not have intended to support it.
stbtt_MakeCodepointBitmapSubpixel
void stbtt_MakeCodepointBitmapSubpixel(stbtt_fontinfo* info, ubyte* output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int codepoint)
Undocumented in source. Be warned that the author may not have intended to support it.
stbtt_MakeCodepointBitmapSubpixelPrefilter
void stbtt_MakeCodepointBitmapSubpixelPrefilter(stbtt_fontinfo* info, ubyte* output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int oversample_x, int oversample_y, float* sub_x, float* sub_y, int codepoint)
Undocumented in source. Be warned that the author may not have intended to support it.
stbtt_MakeGlyphBitmap
void stbtt_MakeGlyphBitmap(stbtt_fontinfo* info, ubyte* output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, int glyph)
Undocumented in source. Be warned that the author may not have intended to support it.
stbtt_MakeGlyphBitmapSubpixel
void stbtt_MakeGlyphBitmapSubpixel(stbtt_fontinfo* info, ubyte* output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int glyph)
Undocumented in source. Be warned that the author may not have intended to support it.
stbtt_MakeGlyphBitmapSubpixelPrefilter
void stbtt_MakeGlyphBitmapSubpixelPrefilter(stbtt_fontinfo* info, ubyte* output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int prefilter_x, int prefilter_y, float* sub_x, float* sub_y, int glyph)
Undocumented in source. Be warned that the author may not have intended to support it.
stbtt_PackBegin
int stbtt_PackBegin(stbtt_pack_context* spc, ubyte* pixels, int pw, int ph, int stride_in_bytes, int padding, void* alloc_context)
Undocumented in source. Be warned that the author may not have intended to support it.
stbtt_PackEnd
void stbtt_PackEnd(stbtt_pack_context* spc)
Undocumented in source. Be warned that the author may not have intended to support it.
stbtt_PackFontRange
int stbtt_PackFontRange(stbtt_pack_context* spc, const(ubyte)* fontdata, int font_index, float font_size, int first_unicode_codepoint_in_range, int num_chars_in_range, stbtt_packedchar* chardata_for_range)
Undocumented in source. Be warned that the author may not have intended to support it.
stbtt_PackFontRanges
int stbtt_PackFontRanges(stbtt_pack_context* spc, const(ubyte)* fontdata, int font_index, stbtt_pack_range* ranges, int num_ranges)
Undocumented in source. Be warned that the author may not have intended to support it.
stbtt_PackFontRangesGatherRects
int stbtt_PackFontRangesGatherRects(stbtt_pack_context* spc, stbtt_fontinfo* info, stbtt_pack_range* ranges, int num_ranges, stbrp_rect* rects)
Undocumented in source. Be warned that the author may not have intended to support it.
stbtt_PackFontRangesPackRects
void stbtt_PackFontRangesPackRects(stbtt_pack_context* spc, stbrp_rect* rects, int num_rects)
Undocumented in source. Be warned that the author may not have intended to support it.
stbtt_PackFontRangesRenderIntoRects
int stbtt_PackFontRangesRenderIntoRects(stbtt_pack_context* spc, stbtt_fontinfo* info, stbtt_pack_range* ranges, int num_ranges, stbrp_rect* rects)
Undocumented in source. Be warned that the author may not have intended to support it.
stbtt_PackSetOversampling
void stbtt_PackSetOversampling(stbtt_pack_context* spc, uint h_oversample, uint v_oversample)
Undocumented in source. Be warned that the author may not have intended to support it.
stbtt_Rasterize
void stbtt_Rasterize(stbtt__bitmap* result, float flatness_in_pixels, stbtt_vertex* vertices, int num_verts, float scale_x, float scale_y, float shift_x, float shift_y, int x_off, int y_off, int invert, void* userdata)
Undocumented in source. Be warned that the author may not have intended to support it.
stbtt_ScaleForMappingEmToPixels
float stbtt_ScaleForMappingEmToPixels(const(stbtt_fontinfo)* info, float pixels)
Undocumented in source. Be warned that the author may not have intended to support it.
stbtt_ScaleForPixelHeight
float stbtt_ScaleForPixelHeight(const(stbtt_fontinfo)* info, float height)
Undocumented in source. Be warned that the author may not have intended to support it.
stbtt__GetGlyphInfoT2
int stbtt__GetGlyphInfoT2(stbtt_fontinfo* info, int glyph_index, int* x0, int* y0, int* x1, int* y1)
Undocumented in source. Be warned that the author may not have intended to support it.

Structs

DrawingTextContext
struct DrawingTextContext
Undocumented in source.
TtfFont
struct TtfFont
stbtt__bitmap
struct stbtt__bitmap
Undocumented in source.
stbtt__buf
struct stbtt__buf
Undocumented in source.
stbtt_aligned_quad
struct stbtt_aligned_quad
Undocumented in source.
stbtt_bakedchar
struct stbtt_bakedchar

///////////////////////////////////////////////////////////////////////////

stbtt_fontinfo
struct stbtt_fontinfo
Undocumented in source.
stbtt_pack_context
struct stbtt_pack_context
Undocumented in source.
stbtt_pack_range
struct stbtt_pack_range
Undocumented in source.
stbtt_packedchar
struct stbtt_packedchar
Undocumented in source.
stbtt_vertex
struct stbtt_vertex
Undocumented in source.

Meta

Credits

Started as a copy of stb_truetype by Sean Barrett and ketmar helped with expansions.